-
Notifications
You must be signed in to change notification settings - Fork 1.8k
First solution. #2401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
First solution. #2401
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Summary
REQUEST_CHANGES
Thank you for your submission! You have a solid grasp of object-oriented programming, inheritance, and method overriding. However, there are a couple of critical issues that must be addressed before your code can be approved:
-
Incorrect main method signature in MainApp.java
- The method is named
Main
instead ofmain
, and its signature does not match the required Java entry point (public static void main(String[] args)
). - Why this matters: Java will not recognize your entry point, so your program will not run. This is a critical blocker.
- How to fix: Rename the method to
main
and ensure the signature is exactly:public static void main(String[] args)
- The method is named
-
Printed messages do not capitalize the machine type
- In
Truck.java
,Bulldozer.java
, andExcavator.java
, the messages use lowercase (e.g., "truck") instead of the required capitalized form ("Truck"). - Why this matters: The checklist explicitly requires that messages clearly indicate the machine type using proper capitalization for clarity and professionalism.
- How to fix: Update all printed messages to use "Truck", "Bulldozer", and "Excavator" (capitalized) in both
doWork()
andstopWork()
methods.
- In
Next Steps:
- Fix the main method signature in
MainApp.java
. - Update the output messages in all machine subclasses to use the correct capitalization.
Once these changes are made, your code should fully meet all requirements. Keep up the good work—you're very close to a perfect solution!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review
button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor
tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
|
||
@Override | ||
public void doWork() { | ||
System.out.println("The bulldozer is working."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The printed messages should use "Bulldozer" (capitalized) instead of "bulldozer" to clearly indicate the machine type, as required by the checklist: "All messages printed in doWork() and stopWork() must be in English and must be informative, indicating the type of machine (Truck, Bulldozer, or Excavator) that is working or stopped."
|
||
@Override | ||
public void stopWork() { | ||
System.out.println("The bulldozer has stopped."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The printed messages should use "Bulldozer" (capitalized) instead of "bulldozer" to clearly indicate the machine type, as required by the checklist: "All messages printed in doWork() and stopWork() must be in English and must be informative, indicating the type of machine (Truck, Bulldozer, or Excavator) that is working or stopped."
|
||
@Override | ||
public void doWork() { | ||
System.out.println("The excavator is working."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The printed messages should use "Excavator" (capitalized) instead of "excavator" to clearly indicate the machine type, as required by the checklist: "All messages printed in doWork() and stopWork() must be in English and must be informative, indicating the type of machine (Truck, Bulldozer, or Excavator) that is working or stopped."
|
||
@Override | ||
public void stopWork() { | ||
System.out.println("The excavator has stopped."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The printed messages should use "Excavator" (capitalized) instead of "excavator" to clearly indicate the machine type, as required by the checklist: "All messages printed in doWork() and stopWork() must be in English and must be informative, indicating the type of machine (Truck, Bulldozer, or Excavator) that is working or stopped."
package core.basesyntax; | ||
|
||
public class MainApp { | ||
public static void Main () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main method is incorrectly named Main
and does not have the correct signature. It should be public static void main(String[] args)
to serve as the Java entry point. This violates checklist item #1: "In MainApp, create an array of type Machine containing instances of Truck, Bulldozer, and Excavator" and the general requirement for a valid Java main method.
|
||
@Override | ||
public void doWork() { | ||
System.out.println("The truck is working."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The printed messages should use "Truck" (capitalized) instead of "truck" to clearly indicate the machine type, as required by the checklist: "All messages printed in doWork() and stopWork() must be in English and must be informative, indicating the type of machine (Truck, Bulldozer, or Excavator) that is working or stopped."
|
||
@Override | ||
public void stopWork() { | ||
System.out.println("The truck has stopped."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The printed messages should use "Truck" (capitalized) instead of "truck" to clearly indicate the machine type, as required by the checklist: "All messages printed in doWork() and stopWork() must be in English and must be informative, indicating the type of machine (Truck, Bulldozer, or Excavator) that is working or stopped."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Summary
All core requirements for this assignment are fully met. Your implementation demonstrates a solid understanding of object-oriented principles, including abstraction, inheritance, and polymorphism. Each class is correctly structured, method overrides are clear and informative, and your MainApp
class showcases the required functionality using a Machine[]
array. There are no critical issues or blockers. Great job—keep up the good work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.